package rule

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type RulesRouter struct {}

// InitRulesRouter 初始化 rules表 路由信息
func (s *RulesRouter) InitRulesRouter(Router *gin.RouterGroup,PublicRouter *gin.RouterGroup) {
	rulesRouter := Router.Group("rules").Use(middleware.OperationRecord())
	rulesRouterWithoutRecord := Router.Group("rules")
	rulesRouterWithoutAuth := PublicRouter.Group("rules")
	{
		rulesRouter.POST("createRules", rulesApi.CreateRules)   // 新建rules表
		rulesRouter.DELETE("deleteRules", rulesApi.DeleteRules) // 删除rules表
		rulesRouter.DELETE("deleteRulesByIds", rulesApi.DeleteRulesByIds) // 批量删除rules表
		rulesRouter.PUT("updateRules", rulesApi.UpdateRules)    // 更新rules表
	}
	{
		rulesRouterWithoutRecord.GET("findRules", rulesApi.FindRules)        // 根据ID获取rules表
		rulesRouterWithoutRecord.GET("getRulesList", rulesApi.GetRulesList)  // 获取rules表列表
	}
	{
	    rulesRouterWithoutAuth.GET("getRulesPublic", rulesApi.GetRulesPublic)  // rules表开放接口
	}
}
